/**
 * 
 */
package exercicebucles1;

import java.util.Scanner;

/**
 * @author drodrigo_martinez
 *
 */
public class bucles1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		//1.- definir variables
		int number = 0;
		int solution = 1;
		int i;
		String line = "";
		Scanner reader = new Scanner(System.in);
		
		//2.- Solicitar al usuario un numero
		System.out.println("Write a number: ");
		line = reader.nextLine();
		
		//3.- Convertir a entero
		number = Integer.parseInt(line);
		
		
		for (i= number; i>0; i--) {
			solution= number * solution;
			number--;
		}
		
		/*do {
			solution= number * solution;
			number--;
		} while (number > 0);
		*/
		System.out.println("The factorial number is " + solution );
		
	}

}
